by Josh Nixon (6 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)
This code will load a picture in mem on form load. Its show how also to do an animation with bitblt. Loading it in memory not only makes fps faster but the program itself.
Assumes
This code will load a picture in mem on form load. Its show how also to do an animation with bitblt. Loading it in memory not only makes fps faster but the program itself.
Code Returns
Satafaction
API DeclarationsPrivate Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Const SRCAND = &H8800C6
Const SRCPAINT = &HEE0086